# encoding: utf-8
from flask_marshmallow import base_fields
from flask_restplus_patched import Parameters


class Default(Parameters):
    pass


class MenuParameters(Parameters):
    role_id = base_fields.String(
        description = "角色ID",
        missing = None,  # default value
    )
    token_id = base_fields.String(
        description = "登陆ID",
        required = True,
    )


class MenuAddParameters(Parameters):
    menu_name = base_fields.String(
        description = "菜单名称",
        required = True
    )
    menu_url = base_fields.String(
        description = "菜单链接",
        missing = None
    )
    menu_css = base_fields.String(
        description = "菜单样式",
        missing = None
    )
    menu_level = base_fields.Integer(
        description = "菜单级别",
        required = True,
        missing = 1,
        enum = [1, 2]
    )
    parent_menu_id = base_fields.String(
        description = "上级菜单ID",
        missing = None
    )
    token_id = base_fields.String(
        description = "登陆ID",
        required = True,
    )


class MenuUpdateParameters(Parameters):
    menu_id = base_fields.String(
        description = "菜单ID",
        required = True
    )
    menu_name = base_fields.String(
        description = "菜单名称",
        missing = None
    )
    menu_url = base_fields.String(
        description = "菜单链接",
        missing = None
    )
    menu_css = base_fields.String(
        description = "菜单样式",
        missing = None
    )
    menu_status = base_fields.Integer(
        description = "菜单状态 0 可用 1 不可用",
        required = True,
        missing = 0,
        enum = [0, 1]
    )
    token_id = base_fields.String(
        description = "登陆ID",
        required = True,
    )


class MenuDelParameters(Parameters):
    menu_id = base_fields.String(
        description = "菜单ID",
        required = True
    )
    token_id = base_fields.String(
        description = "登陆ID",
        required = True,
    )
